class Convert(object):

    def __init__(self):
        super(Convert, self).__init__()

    @staticmethod
    def __Pneumatic2Valve(pneumatic):
        """
        Pneumatic Voltage Convert
        :param pneumatic: pneumatic
        :return: voltage
        """
        return (5 * float(pneumatic) / 100) + 5

    @staticmethod
    def __Valve2Pneumatic(voltage):
        """
        Voltage Pneumatic Convert
        :param voltage: voltage
        :return:  pneumatic
        """
        return float(voltage - 5) * 100 / 5

    @staticmethod
    def __Valve2Arduino(voltage):
        """
        Valve Arduino Convert
        :param voltage: Valve value
        :return: arduino value
        """
        return (float(voltage) - 0.0851) / 2.1263

    @staticmethod
    def __Arduino2Valve(value):
        """
        Arduino Valve Convert
        :param value: arduino value
        :return: valve value
        """
        return float(value) * 2.1263 + 0.0851

    @staticmethod
    def __Arduino2Input(value):
        """
        Arduino Input Convert
        :param value: arduino value
        :return: input value
        """
        return float(value) * 1000

    @staticmethod
    def __Input2Arduino(value):
        """
        Input Arduino Convert
        :param value: input value
        :return: arduino value
        """
        return float(value) / 1000

    @staticmethod
    def Input2Pneumatic(value):
        arduino_value = Convert.__Input2Arduino(value)
        valve_value = Convert.__Arduino2Valve(arduino_value)
        pneumatic_value = Convert.__Valve2Pneumatic(valve_value)

        return pneumatic_value

    @staticmethod
    def Pneumatic2Input(pneumatic):
        valve_value = Convert.__Pneumatic2Valve(pneumatic)
        arduino_value = Convert.__Valve2Arduino(valve_value)
        input_value = int(Convert.__Arduino2Input(arduino_value))

        return input_value
